<style lang="scss" scoped>
.systemBox {
  padding: 10px;
  .texts {
    margin-bottom: 10px;
    padding: 10px;
    margin-top: 10px;
    width: 100%;
    border: 1px solid #efefef;
    span {
      font-size: 16px;
    }
  }
}
</style>
<template>
  <div class="systemBox">
    <van-nav-bar title="问诊消息" left-arrow @click-left="$router.push('/mymessage')" />
    <div class="texts" v-for="(item, index) in inqMsg" :key="index">
      <div style="display: flex; align-items: center; justify-content: space-between;">
        <span>{{ item.content }}</span>
        <span style="color: blue;" @click="$router.push('/chat')">立即查看>></span>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'
import { request } from '../../axios/request'
import { ref } from 'vue'

// 获取userId, sessionId
const doctorId = ref(JSON.parse(localStorage.getItem('doctorId')|| '') )
const sessionId = ref(JSON.parse(localStorage.getItem('sessionId')|| '') )


// 系统消息
const inqMsg:any = ref([])
const getInq = async () => {
  await request
    .get('/api/health/doctor/verify/v1/findDoctorInquiryNoticeList', {
      params: {
        page: 1,
        count: 10
      },
      headers: {
        doctorId: doctorId.value as number,
        sessionId: sessionId.value as string
      }
    })
    .then((res) => {
      console.log(res.data)
      inqMsg.value = res.data.result
      console.log(inqMsg.value)
    })
}
getInq()
</script>